<!DOCTYPE html>
<!--
  Copyright (C) 2012 Binux <17175297.hk@gmail.com>

  This file is part of YAAW (https://github.com/binux/yaaw).

  YAAW is free software: you can redistribute it and/or modify
  it under the terms of the GNU Lesser General Public License as
  published by the Free Software Foundation, either version 3 of
  the License, or (at your option) any later version.

  YAAW is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU Lesser General Public License for more details.

  You may get a copy of the GNU Lesser General Public License
  from http://www.gnu.org/licenses/lgpl.txt
-->
<html lang="cn" manifest="offline.appcache">
    <head>
        <meta charset=utf-8 />
        <title>极光远程下载</title>
        <meta name="author" content="Binux" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <link href="css/main.css" rel="stylesheet" />
        <link href="css/fcstyle.css" rel="stylesheet" />
        <link href="css/bootstrap.min.css" rel="stylesheet" />
        <!--[if IE]>
          <script src="js/html5.js"></script>
          <script type="text/javascript">alert('您正在使用 IE 浏览器，部分功能将无法使用！');</script>
        <![endif]-->
        <script>
            if(navigator.userAgent.match(/android|phone|BlackBerry|ipod|iphone|nokia/i)){
                window.location.href = "mobile.html";
            }
            if(navigator.userAgent.match(/msie|Trident/i)){
                alert('您正在使用 IE 浏览器，部分功能将无法使用！');
                var script = document.createElement('script');
                script.src = 'js/html5.js';
                main_alert("alert-error", "您正在使用 IE 浏览器，部分功能将无法使用！");
            }
        </script>
    </head>
    <body>
        <div class="container">
            <header class="main-head page-header">
                <img src="img/yc-xunlei-logo.png" />
            </header>
            <div class="left-frame">
                <div class="left-top-padding"></div>
                <div class="my-downloader">
                    <span class="title">我的下载器</span>
                    <div class="mydev">
                        <img src="img/icon-mydev.png" />
                        我的兼容下载机
                    </div>
                    <div id="aria2-downloading" class="current" onclick="document.getElementById('active-tasks').style.display='block';document.getElementById('other-tasks').style.display='none';document.getElementById('aria2-downloading').className='current';document.getElementById('aria2-other').className='';">
                        <img src="img/icon-download-2.png" style="margin-top: -2px; margin-right:5px;"/>
                        正在下载
                    </div>
                    <div id="aria2-other" onclick="document.getElementById('active-tasks').style.display='none';document.getElementById('other-tasks').style.display='block';document.getElementById('aria2-downloading').className='';document.getElementById('aria2-other').className='current';">
                        <img src="img/icon-other.png" style="margin-top: -2px; width:14px; margin-right:5px;"/>
                        其他任务
                    </div>
                </div>
                <div class="aria2-info">
                    <span class="title">系统信息</span><br/>
                    <div class="a">
                        <div class="ab">系统版本: <span id="aria2-version">联机中</span></div><br/>
                        <div class="ab">下载速度: <span id="download-speed">0 KB/s</span></div><br/>
                        <div class="ab">上传速度: <span id="upload-speed">0 KB/s</span></div><br/>
                    </div>
                </div>
            </div>
            <div class="right-frame">
                <div class="clearfix" id="main-control">
                    <div id="main-alert" class="hide">
                        <div id="main-alert-inline" class="alert">
                            <a href="###" onclick="$('#main-alert').hide();" class="close">×</a>
                            <span class="alert-msg">Loading</span>
                        </div>
                    </div>
                    <div class="pull-left">
                        <div class="btn-group btn-inline">
                            <a class="btn" id="add-task-btn" data-toggle="modal" href="#add-task-modal" rel="tooltip" title="添加任务">
                                <i class="icon-new"></i> 新建
                            </a>
                        </div>
                    </div>
                    <div class="pull-left" id="not-selected-grp">
                        <div class="btn-group btn-inline">
                            <a class="btn" id="add-task-btn" data-toggle="modal" href="#" rel="tooltip" title="开始选中任务">
                                <i class="icon-start-alt"></i> 开始
                            </a>
                            <a class="btn" id="add-task-btn" data-toggle="modal" href="#" rel="tooltip" title="暂停选中任务">
                                <i class="icon-pause-alt"></i> 暂停
                            </a>
                            <a class="btn" id="add-task-btn" data-toggle="modal" href="#" rel="tooltip" title="取消选中任务">
                                <i class="icon-delete-alt"></i> 删除
                            </a>
                        </div>
                    </div>
                    <div class="pull-left hide" id="selected-grp">
                        <div class="btn-group btn-inline">
                            <a href="###" onclick="YAAW.tasks.unpause();
                        YAAW.tasks.unSelectAll();" class="btn" rel="tooltip" title="开始选中任务">
                                <i class="icon-start"></i> 开始
                            </a>
                            <a href="###" onclick="YAAW.tasks.pause();
                        YAAW.tasks.unSelectAll();" class="btn" rel="tooltip" title="暂停选中任务">
                                <i class="icon-pause"></i> 暂停
                            </a>
                            <a href="###" onclick="YAAW.tasks.remove();
                        YAAW.tasks.unSelectAll();" class="btn" rel="tooltip" title="取消选中任务">
                                <i class="icon-delete"></i> 删除
                            </a>
                        </div>
                    </div>
                    <div class="pull-left" id="not-selected-grp">
                        <div class="btn-group btn-inline" style="border-right:none;">
                            <a href="###" onclick="ARIA2.purge_download_result();" class="btn" id="pure-all" rel="tooltip" title="清除已完成">
                                <i class="icon-trash"></i> 清除完成
                            </a>
                        </div>
                    </div>
                    <div class="pull-right" id="other-grp">
                        <div class="btn-group btn-inline" style="border-right:none;">
                            <a href="#" class="btn" id="refresh-btn" rel="tooltip" title="刷新任务列表">
                                <i class="icon-refresh"></i> 刷新
                            </a>
                            <a class="btn" id="setting-btn" data-toggle="modal" href="#setting-modal" rel="tooltip" title="设置">
                                <i class="icon-settings"></i>
                            </a>
                        </div>
                    </div>
                </div>
                <section id="active-tasks">
                    <div class="section-header">
                        <i class="icon-chevron-down"></i><b>下载中</b>
                    </div>
                    <div class="item-bar">
                        <span class="status">状态</span>
                        <span class="size">已下 / 总大小</span>
                        <span class="time">剩余时间</span>
                        <span class="prog">进度 / 速度 / 连接数</span>
                    </div>
                    <ul class="tasks-table" id="active-tasks-table">
                        <li>
                            <div class="empty-tasks">
                                <strong>没有任务</strong>
                            </div>
                        </li>
                    </ul>
                </section>
                <section id="other-tasks">
                    <div class="section-header">
                        <i class="icon-chevron-down"></i><b>其他</b>
                    </div>
                    <div class="item-bar">
                        <span class="status">状态</span>
                        <span class="filename">文件名 / 文件大小</span>
                        <span class="prog">进度</span>
                    </div>
                    <ul id="waiting-tasks-table" class="tasks-table">
                        <li>
                            <div class="empty-tasks">
                                <strong>没有任务</strong>
                            </div>
                        </li>
                    </ul>
                    <ul id="stoped-tasks-table" class="tasks-table"> </ul>
                </section>
            </div>
        </div>
        <ul id="task-contextmenu" class="dropdown-menu">
            <li class="task-restart"><a href="###" onclick="YAAW.contextmenu.restart();">重试</a></li>
            <li class="task-start"><a href="###" onclick="YAAW.contextmenu.unpause();">开始</a></li>
            <li><a href="###" onclick="YAAW.contextmenu.pause();">暂停</a></li>
            <li><a href="###" onclick="YAAW.contextmenu.remove();">删除</a></li>
            <li class="task-move divider"></li>
            <li class="task-move"><a href="###" onclick="YAAW.contextmenu.movetop();">移到顶端</a></li>
            <li class="task-move"><a href="###" onclick="YAAW.contextmenu.moveup();">上移</a></li>
            <li class="task-move"><a href="###" onclick="YAAW.contextmenu.movedown();">下移</a></li>
            <li class="task-move"><a href="###" onclick="YAAW.contextmenu.moveend();">移到低端</a></li>
        </ul>
        <section class="modal hide fade" id="add-task-modal">
            <div class="modal-header">
                <button class="close" data-dismiss="modal">×</button>
                <h3>添加</h3>
            </div>
            <div class="modal-body">
                <div id="add-task-alert" class="alert alert-error hide">
                    <a href="###" onclick="$('#add-task-alert').hide();" class="close">×</a>
                    <strong>Error:</strong> <span class="alert-msg"></span>
                </div>
                <form id="add-task-uri" onsubmit="YAAW.add_task.submit(this);
              return false;">
                    <div class="input-append">
                        <input type="text" name="uri" id="uri-input" class="input-clear" placeholder="HTTP、FTP下载链接，BT种子，或磁力链接" /><span><input type="file" id="torrent-up-input" /><a id="torrent-up-btn" class="btn" rel="tooltip" title="File API is Not Supported.">上传BT种子</a></span>
                    </div>
                    <textarea id="uri-textarea" rows=5 class="input-clear hide" placeholder="HTTP, FTP or Magnet"></textarea>
                </form>
                <div id="uri-more"><span class="or-and">&or;&or;&or;&or;&or;&or;</span><span class="or-and" style="display:none;">&and;&and;&and;&and;&and;&and;</span></div>
                <div id="add-task-option-wrap"></div>
            </div>
            <div class="modal-footer">
                <a href="###" onclick="$('#add-task-uri').submit();" id="add-task-submit" class="btn btn-primary">添加</a>
                <a href="###" onclick="YAAW.add_task.clean();" class="btn" data-dismiss="modal">取消</a>
            </div>
        </section>
        <section class="modal hide fade" id="setting-modal">
            <div class="modal-header">
                <button class="close" data-dismiss="modal">×</button>
                <h2>设置</h2>
            </div>
            <div class="modal-body">
                <form id="setting-form" class="form-horizontal" onsubmit="YAAW.setting.submit();
              return false;">
                    <fieldset>
                        <div class="control-group">
                            <label class="control-label" for="rpc-path">JSON-RPC 链接</label>
                            <div class="controls">
                                <div class="input-append btn-group rpc-path-wrap">
                                    <input type="text" class="input-xlarge pull-left" id="rpc-path"><a class="add-on btn dropdown-toggle" href="#" disabled><b class="caret"></b></a>
                                </div>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">自动刷新</label>
                            <div class="controls">
                                <label class="radio inline" style="width:40px">
                                    <input type="radio" name="refresh_interval" value="5000"> 每5秒
                                </label>
                                <label class="radio inline" style="width:40px">
                                    <input type="radio" name="refresh_interval" value="10000" checked> 每10秒
                                </label>
                                <label class="radio inline" style="width:40px">
                                    <input type="radio" name="refresh_interval" value="30000"> 每30秒
                                </label>
                                <label class="radio inline" style="width:46px">
                                    <input type="radio" name="refresh_interval" value="300000"> 每5分钟
                                </label>
                                <label class="radio inline" style="width:40px">
                                    <input type="radio" name="refresh_interval" value="0"> 关闭
                                </label>
                            </div>
                        </div>
                    </fieldset>
                </form>
                <div id="aria2-gsetting">
                </div>
            </div>
            <div class="modal-footer">
                <div id="copyright">© Copyright <a href="http://www.fcsys.org">FC-System Computer Inc</a>. (Yaaw by <a href="https://github.com/binux/yaaw">Binux</a>)</div>
                <a href="###" onclick="$('#setting-form').submit();" class="btn btn-success">保存</a>
                <a href="#" class="btn" data-dismiss="modal">取消</a>
            </div>
        </section>
        <script id="global-speed-tpl" type="text/mustache-template">
            <i class="icon-download"></i> <span>{{#_v.format_size}}{{downloadSpeed}}{{/_v.format_size}}</span>/s
            / 
            <i class="icon-upload"></i>  <span>{{#_v.format_size}}{{uploadSpeed}}{{/_v.format_size}}</span>/s
        </script>
        <script id="active-task-tpl" type="text/mustache-template">
            {{#tasks}}
            <li class="task" id="task-gid-{{gid}}" data-status="{{status}}" data-gid="{{gid}}">
            <div class="task-padding"></div>
            <i class="select-box"></i>
            <span class="task-status" rel="tooltip" title="{{status}} {{#_v.error_msg}}{{errorCode}}{{/_v.error_msg}}"><i class="{{#_v.status_icon}}{{status}}{{/_v.status_icon}}"></i></span>
            <div class="file-img"><img src="img/1.png"/></div>
            <div class="left-area">
            <div class="task-name">
            <span title="{{title}}">{{title}}</span>
            </div>
            <div class="task-info">
            <span>{{#_v.format_size}}{{completedLength}}{{/_v.format_size}} / {{#_v.format_size}}{{totalLength}}{{/_v.format_size}}</span>
            {{#uploadLength}}<span>(uploaded {{#_v.format_size}}{{uploadLength}}{{/_v.format_size}})</span>{{/uploadLength}}
            {{#etc}}<span>预计时间: {{#_v.format_time}}{{etc}}{{/_v.format_time}}</span>{{/etc}}
            </div>
            </div>
            <div class="right-area">
            <div class="progress progress-striped active">
            <div class="bar" style="width: {{progress}}%">{{progress}}%</div>
            </div>
            <div class="progress-info">
            {{#downloadSpeed}}<span class="download-speed"><i class="icon-download"></i> {{#_v.format_size}}{{downloadSpeed}}{{/_v.format_size}}/s</span>{{/downloadSpeed}}
            {{#uploadSpeed}}<span class="upload-speed"><i class="icon-upload"></i> {{#_v.format_size}}{{uploadSpeed}}{{/_v.format_size}}/s</span>{{/uploadSpeed}}
            {{#connections}}<span class="seeders"><i class="icon-signal" rel="tooltip" title="Connections"></i> {{connections}}</span>{{/connections}}
            {{#numSeeders}}<span class="seeders"><i class="icon-magnet" rel="tooltip" title="Seeders"></i> {{numSeeders}}</span>{{/numSeeders}}
            </div>
            </div>
            </li>
            {{/tasks}}
            {{^tasks}}
            <li>
            <div class="empty-tasks">
            <strong>没有任务</strong>
            </div>
            </li>
            {{/tasks}}
        </script>
        <script id="other-task-tpl" type="text/mustache-template">
            {{#tasks}}
            <li class="task" id="task-gid-{{gid}}" data-status="{{status}}" data-gid="{{gid}}" data-infohash="{{infoHash}}" style="height: 55px">
            <div class="task-padding"></div>
            <i class="select-box"></i>
            <span class="task-status" rel="tooltip" title="{{status}} {{#_v.error_msg}}{{errorCode}}{{/_v.error_msg}}"><i class="{{#_v.status_icon}}{{status}}{{/_v.status_icon}}"></i></span>
            <div class="file-img"><img src="img/1.png"/></div>
            <div class="left-area">
            <div class="task-name">
            <span title="{{title}}">{{title}}</span>
            </div>
            <div class="task-info pull-left" style="margin-left: 4px">
            <span>{{#_v.format_size}}{{totalLength}}{{/_v.format_size}}</span>
            {{#uploadLength}}<span>(up {{#_v.format_size}}{{uploadLength}}{{/_v.format_size}}){{/uploadLength}}
            </div>
            </div>
            <div class="right-area">
            <div class="progress progress-striped" style="margin-top: 12px">
            <div class="bar" style="width: {{progress}}%">{{progress}}%</div>
            </div>
            </div>
            </li>
            {{/tasks}}
        </script>
        <script id="ib-status-tpl" type="text/mustache-template">
            <ul>
            <li><strong>大小: </strong>{{#_v.format_size}}{{totalLength}}{{/_v.format_size}} ({{numPieces}} @ {{#_v.format_size}}{{pieceLength}}{{/_v.format_size}})</li>
            <li><strong>状态: </strong>{{status}} {{error_msg}}</li>
            <li><strong>路径: </strong>{{dir}}</li>
            {{#bittorrent}}
            {{#creationDate}}<li>Torrent Created At {{creationDate}}</li>{{/creationDate}}
            {{#comment}}<li><strong>Comment: </strong>{{comment}}</li>{{/comment}}
            {{/bittorrent}}
            <li class="bitfield"><strong>Bitfield: </strong>{{#_v.bitfield}}{{bitfield}}{{/_v.bitfield}}</li>
            </ul>
        </script>
        <script id="ib-files-tpl" type="text/mustache-template">
            <div id="ib-file-btn">
            <button id="ib-file-save" class="btn btn-primary">保存</button>
            <button id="ib-file-select" class="btn">全选</button>
            <button id="ib-file-unselect" class="btn">全不选</button>
            </div>
            <ul>
            {{#files}}
            <li>
            <i class="select-box{{#selected}} icon-ok{{/selected}}" data-index="{{index}}"></i>
            <span class="ib-file-title">{{title}}</span>
            <span class="ib-file-size"> {{#_v.format_size}}{{completedLength}}{{/_v.format_size}} / {{#_v.format_size}}{{length}}{{/_v.format_size}}</span>
            </li>
            {{/files}}
            </ul>
        </script>
        <script id="ib-options-tpl" type="text/mustache-template">
            <div id="ib-options-btn">
            <button id="ib-options-save" class="btn btn-primary">保存</button>
            </div>
            <form id="ib-options-form" class="form-horizontal" onsubmit="false">
            <ul>
            <li><span>下载限速:</span><input name="max-download-limit" class="active-allowed" value="{{max-download-limit}}" /></li>
            <li><span>上传限速:</span><input name="max-upload-limit" class="active-allowed" value="{{max-upload-limit}}" /></li>
            <li><span>Split:</span><input name="split" value="{{split}}" /></li>
            <li><span>Conn per Serv:</span><input name="max-connection-per-server" value="{{max-connection-per-server}}" /></li>
            <li><span>Split Size:</span><input name="min-split-size" value="{{min-split-size}}" /></li>
            </form>
        </script>
        <script id="other-task-empty" type="text/mustache-template">
            <li>
            <div class="empty-tasks">
            <strong>没有任务</strong>
            </div>
            </li>
        </script>
        <script id="add-task-option-tpl" type="text/mustache-template">
            <hr />
            <form id="add-task-option" class="form-horizontal" onsubmit="false">
            <div class="control-group">
            <label class="control-label" for="ati-out">文件名</label>
            <div class="controls">
            <input id="ati-out" class="input-xlarge input-clear" name="out" />
            </div>
            </div>
            <div class="control-group">
            <label class="control-label" for="ati-dir">路径</label>
            <div class="controls">
            <input id="ati-dir" class="input-xlarge" name="dir" />
            </div>
            </div>
            <div class="clearfix"></div>
            <div class="control-group half">
            <div class="controls">
            <label class="checkbox">
            <input type="checkbox" name="pause" class="input-save" {{#pause}}checked{{/pause}} />
            添加后暂停
            </label>
            </div>
            </div>
            <div class="control-group half">
            <div class="controls">
            <label class="checkbox">
            <input type="checkbox" name="parameterized-uri" class="input-save" {{#parameterized-uri}}checked{{/parameterized-uri}} />
            URL参数化
            </label>
            </div>
            </div>
            <div class="clearfix"></div>
            <div class="control-group half">
            <label class="control-label" for="ati-split">分割数</label>
            <div class="controls">
            <input id="ati-split" class="input-small input-save" name="split" value="{{split}}" />
            </div>
            </div>
            <div class="control-group half">
            <label class="control-label" for="ati-cps">并发连接数</label>
            <div class="controls">
            <input id="ati-cps" class="input-small input-save" name="max-connection-per-server" value="{{max-connection-per-server}}" />
            </div>
            </div>
            <div class="control-group half">
            <label class="control-label" for="ati-sr">种子做种率</label>
            <div class="controls">
            <input id="ati-sr" class="input-small input-save" name="seed-ratio" value="{{seed-ratio}}" />
            </div>
            </div>
            <div class="control-group half">
            <label class="control-label" for="ati-st">做种时间</label>
            <div class="controls">
            <input id="ati-st" class="input-small input-save" name="seed-time" value="{{seed-time}}" />
            </div>
            </div>
            <div class="clearfix"></div>
            <div class="control-group">
            <label class="control-label" for="ati-header">HTTP头</label>
            <div class="controls">
            <textarea id="ati-header" class="input-xlarge input-save" name="header" warp="off">{{header}}</textarea>
            </div>
            </div>
            </form>
        </script>
        <script id="aria2-global-setting-tpl" type="text/mustache-template">
            <hr />
            <form id="aria2-gs-form" class="form-horizontal" onsubmit="false">
            <div class="control-group half">
            <label class="control-label" for="gsi-dl">下载限速</label>
            <div class="controls">
            <input id="gsi-dl" name="max-overall-download-limit" class="input-small" value="{{max-overall-download-limit}}" />
            </div>
            </div>
            <div class="control-group half">
            <label class="control-label" for="gsi-ul">上传限速</label>
            <div class="controls">
            <input id="gsi-ul" name="max-overall-upload-limit" class="input-small" value="{{max-overall-upload-limit}}" />
            </div>
            </div>
            <div class="control-group half">
            <label class="control-label" for="gsi-cd">下载连接数</label>
            <div class="controls">
            <input id="gsi-cd" name="max-concurrent-downloads" class="input-small" value="{{max-concurrent-downloads}}" />
            </div>
            </div>
            <div class="control-group half">
            <label class="control-label" for="gsi-mss">最小文件分割大小</label>
            <div class="controls">
            <input id="gsi-mss" name="min-split-size" class="input-small" value="{{#_v.format_size_0}}{{min-split-size}}{{/_v.format_size_0}}" />
            </div>
            </div>
            <div class="clearfix"></div>

            <div class="control-group">
            <label class="control-label" for="gsi-ua">下载器UA</label>
            <div class="controls">
            <input id="gsi-ua" name="user-agent" class="input-xlarge" value="{{user-agent}}" />
            </div>
            </div>
            <div class="control-group">
            <label class="control-label" for="gsi-dir">下载目录</label>
            <div class="controls">
            <input id="gsi-dir" name="dir" class="input-xlarge" value="{{dir}}" disabled />
            </div>
            </div>
            </form>
        </script>
        <script src="js/jquery-1.7.2.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <script src="js/jquery.jsonrpc.js"></script>
        <script src="js/jquery.Storage.js"></script>
        <script src="js/jquery.base64.min.js"></script>
        <script src="js/mustache.js"></script>
        <script src="js/aria2.js"></script>
        <script src="js/yaaw.js"></script>
        <script>
            function reSizeRF() {
                var gWidth = document.documentElement.clientWidth;
                var gHieght = document.documentElement.clientHeight;
                var rfObj = document.getElementsByClassName('right-frame')[0];
                var ataskObj = document.getElementById('active-tasks');
                var otaskObj = document.getElementById('other-tasks');
                if(gWidth < 900) {
                    rfObj.style.width = "679px";
                } else {
                    rfObj.style.width = (gWidth - 221) + "px";
                }
                ataskObj.style.height = (gHieght - 135) + "px";
                otaskObj.style.height = (gHieght - 135) + "px";
            }
            window.onload = reSizeRF;
            window.onresize = reSizeRF;
        </script>
        <!--统计代码只在yc.fcsys.org生效--><script>if(window.location.href.match(/fcsys/i)){var _hmt=_hmt||[];(function(){var hm=document.createElement("script");hm.src="//hm.baidu.com/hm.js?8b03fbe181f1821cbcbb22c52a2336da";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm,s);})();}</script><!--GOOGLE--><!--[if!IE]><script>if(window.location.href.match(/fcsys/i)){(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create','UA-49020483-1','fcsys.org');ga('require','displayfeatures');ga('send','pageview');}</script><![endif]-->
    </body>
</html>